#include<stdio.h>
int GetNumber(int array[]);
void Sort(int array[], int size);
int main()
{
	int a[100], b[100], size_a, size_b, i, flag = 0;
	size_a = GetNumber(a);
	size_b = GetNumber(b);
	if (size_a != size_b)
	{
		printf("n");
		flag = 1;
	}
	else
	{
		Sort(a, size_a);
		Sort(b, size_b);
		for (i = 0; i < size_a; i++)
			if (a[i] != b[i])
			{
				printf("n");
				flag = 1;
				break;
			}	
	}
	if (flag == 0)
			printf("y");
	return 0;
}
int GetNumber(int array[])
{
	int count = 0;
	scanf("%d", &array[0]);
	while (array[count] >= 0)
	{
		count++;
		scanf("%d", &array[count]);
	}
	return count;
}
void Sort(int array[],int size)
{
	int i, j, temp;
	for (i = size - 1; i > 0; i--)
		for (j = 0; j < i; j++)
			if (array[j + 1] < array[j])
			{
				temp = array[j];
				array[j] = array[j + 1];
				array[j + 1] = temp;
			}
	return;
}